package com.sen.mapper;

import com.sen.dto.ResourceDTO;
import com.sen.entity.Resource;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author sen
 * @since 2021-03-29
 */
@Repository
public interface ResourceMapper extends BaseMapper<Resource> {

    List<Resource> getResourceByRoleId(Integer id);

    List<ResourceDTO> getResourcesWithRoles();

    /**
     * 根据资源id删除角色资源表中对应的记录
     * @param id
     * @return
     */
    boolean deleteRoleResourceById(Integer id);
}
